<!-- 员工管理 -->
<template>
	<div class="container-body organization-manage">
		
		<div class="page-containerstwo"  v-if="list==''">
			<div class="leftview" >
				<!-- <div class="litem">
					<i class="el-icon-sold-out" style="font-size: 30px;color: #fb333e;"></i>
					<span class="pname">点击批量导入账号文件</span>
				</div> -->
				<el-upload
                  class="pic-uploader-component litem"
                  :action="uploadImgUrl"
                  :headers="headers"
                  :data="uploaddata"
                  :show-file-list="false"
                  :on-success="handleUploadSuccess"
                  :before-upload="beforeAvatarUpload"
                >
				<i class="el-icon-sold-out" style="font-size: 30px;color: #fb333e;"></i>
				<span class="pname">点击批量导入账号文件</span>
                </el-upload>
			</div>
			<div class="rightview">
				<div class="rbuzhou">
					<el-steps direction="vertical" finish-status="success" :active="hindex" >
						<el-step title="导入账号" description="1.先导入账号"></el-step>
						<el-step title="选择账号" description="2.选择账号"></el-step>
						<el-step title="交易" description="3.选择商品开始交易"></el-step>
					</el-steps>
				</div>
				<div class="rview">
					<i class="el-icon-sold-out" style="font-size: 45px;color: #ccc;"></i>
					<span class="pname">请先导入数据在操作！</span>
					<!-- <div id="captcha-element" v-if="popshow"></div> -->
					
					<!-- <button id="button" class="login-btn">登录</button> -->
				</div>
			</div>
		</div>
		<div class="page-containerstwo twoitem" v-if="list!=''">
			<div class="leftview">
				<div class="ltit">账号列表</div>
				<div class="zhanglist">
					<div class="zhangitem" :class="jia.token==item.token?'listactive':''" v-for="(item,index) in list" :key="index" @click="listClick(item)">
						<span class="xuhao">{{ index+1 }}</span>
						<span class="xunum " :class="Number(item.order_num)>0?'xing':''">{{item.token}}</span>
					</div>
				</div>
			</div>
			<div class="rightview" v-if="!isshuju">
				<div class="daoru" @click="getdaoru">重新导入</div>
				<div class="rbuzhou">
					<el-steps direction="vertical" finish-status="success" :active="hindex" >
						<el-step title="导入账号" description="1.先导入账号"></el-step>
						<el-step title="选择账号" description="2.选择账号"></el-step>
						<el-step title="交易" description="3.选择商品开始交易"></el-step>
					</el-steps>
				</div>
				<div class="rview" v-if="list==''">
					<i class="el-icon-sold-out" style="font-size: 45px;color: #ccc;"></i>
					<span class="pname">请先导入数据在操作！</span>
					<div id="captcha-element"></div>
					<!-- v-if="popshow" -->
					<!-- <button id="button" class="login-btn">登录</button> -->
				</div>
			</div>
			<div class="rightview" v-if="isshuju" v-loading="loadingRight"
			 :element-loading-text="ltext"
			element-loading-spinner="el-icon-loading"
			element-loading-background="rgba(0, 0, 0, 0.08)">
				<div class="daoru" @click="getdaoru">重新导入</div>
				<button id="aliyunCaptcha-btn-refresh" ref="reload" aria-label="刷新验证码"></button> 
				<button id="aliyunCaptcha-btn-close" ref="close" aria-label="关闭验证"></button>
				<div class="rhone">
					<span class="dangqian">当前token已下单数{{ tokennum }}</span>
					<div class="rhonediv">
						<div class="rhonedivone">
							<span class="daifu">代付信息</span>
							<span class="daitong ml">代付通信灯</span>
							<span class="quan"></span>
							<span class="quan"></span>
							<span class="quan"></span>
						</div>
						<div class="rhonedivtwo">
							<div class="ditem">
								<span class="blei">宝贝类型</span>
								<div class="leiitem">
									<el-checkbox-group v-model="form.type">
									<el-checkbox label="退货包邮" name="type"></el-checkbox>
									<el-checkbox label="刷新黑名单" name="type"></el-checkbox>
									<el-checkbox label="7天无理由退货" name="type"></el-checkbox>
									<el-checkbox label="屏蔽同省商家" name="type"></el-checkbox>
									</el-checkbox-group>
								</div>
							</div>
							<div class="ditem">
								<span class="blei">浏览宝贝</span>
								<div class="rowitem">
									<el-input v-model="form.mone" placeholder="请输入"></el-input>
									<span class="miaodan">秒</span>
									<span class="guai">～</span>
									<el-input v-model="form.mtwo" placeholder="请输入"></el-input>
									<span class="miaodan">秒</span>
								</div>
							</div>
							<div class="ditem">
								<span class="blei">浏览店铺</span>
								<div class="rowitem">
									<span class="liuname">浏览</span>
									<el-input style="width: 140px;" v-model="form.mthree" placeholder="请输入"></el-input>
									<span class="miaodan">秒</span>
									<span class="guai">～</span>
									<el-input style="width: 140px;" v-model="form.mfour" placeholder="请输入"></el-input>
									<span class="miaodan">秒</span>
								</div>
								<div class="rowitem mt">
									<span class="liuname">货比</span>
									<el-input v-model="form.mfive" placeholder="请输入"></el-input>
									<span class="miaodan">家</span>
								</div>
								<div class="rowitem mt">
									<span class="liuname">浏览</span>
									<el-input v-model="form.msix" style="margin-right: 10px;" placeholder="请输入"></el-input>
									<el-input v-model="form.mseven" placeholder="请输入"></el-input>
									<span class="miaodan">秒</span>
								</div>
								<div class="rowitem mt">
									<span class="liuname">销量</span>
									<el-input v-model="form.meight" style="margin-right: 10px;width: 50%;" placeholder="请输入"></el-input>
									<span class="miaodan">单以下不下单</span>
								</div>
								<div class="rowitem mt">
									<span class="liuname">价格区间</span>
									<el-input @blur="blur" v-model="jia.min_price" style="margin-right: 10px;" placeholder="请输入"></el-input>
									<el-input @blur="blur" v-model="jia.max_price" placeholder="请输入"></el-input>
									
								</div>
							</div>
						</div>
						<div class="rhonedivone" style="border-top: 1px solid #eee;">
							<span class="daifu">下单方案</span>
						</div>
						<div class="rhonedivtwo">
							<div class="rowitem mt xiadan">
								<span class="liuname">下单方式</span>
								<el-select v-model="form.mnine" style="max-width: 200px;" placeholder="请选择活动区域">
								<el-option label="随机选择(开团/拼团)" value="0"></el-option>
								<el-option label="开团" value="1"></el-option>
								<el-option label="拼团" value="2"></el-option>
								</el-select>
							</div>
							<div class="rowitem mt">
								<span class="liuname">收藏选择</span>
								<el-radio-group v-model="form.mten">
								<el-radio label="店铺" value="1"></el-radio>
								<el-radio label="商品" value="2"></el-radio>
								</el-radio-group>
							</div>
							<div class="rowitem mt">
								<span class="liuname">sku选择</span>
								<el-radio-group v-model="form.hone">
								<el-radio label="最低sku" value="1"></el-radio>
								<el-radio label="随机sku" value="2"></el-radio>
								</el-radio-group>
							</div>
							<!-- <div class="rowitem mt">
								<span class="liuname">类型</span>
								<el-radio-group v-model="form.ntype">
								<el-radio label="拼多多" value="1"></el-radio>
								<el-radio label="小红书" value="2"></el-radio>
								</el-radio-group>
							</div> -->
							<div class="rowitem mt">
								
								<el-checkbox-group v-model="form.htwo">
								<el-checkbox label="随机修改名称" name="type"></el-checkbox>
								</el-checkbox-group>
								<el-button type="primary" size="small" style="margin-left: 20px;" @click="czhi">重置</el-button>

							</div>
						</div>
					</div>
				</div>


				<div class="rhtwo">
					<span class="dangqian"></span>
					<div class="rhonediv">
						<div class="rhonedivone">
							<span class="daifu">控制台</span>
						</div>
						<div class="rhonedivtwo">
							<div class="ditemtwo">
								<el-checkbox-group v-model="form.hthree" @change="handleCheckedCitiesChange">
								<el-checkbox label="启用云代理" name="type" ></el-checkbox>
								</el-checkbox-group>
								<div class="rowitem" style="width: 70%;margin-left: 15px;position: relative;top: -5px;">
									<span class="liuname">下单数量</span>
									<el-input style="width: 140px;" v-model="form.nums" placeholder="请输入"></el-input>
									<!--  :loading="loadingbtn" -->
									<el-button type="primary" style="margin-left: 20px;" @click="xiadanone" :loading="loadingbtn">开始下单</el-button>
								</div>
							</div>
						</div>
						<div class="rhonedivone" style="border-top: 1px solid #eee;">
							<span class="daifu">运行日志</span>
						</div>
						<div class="rhonedivtwo">
							<div class="yunlist" id="myDiv" ref="returnTop">
								<span class="rizhi" v-for="(item,index) in rilisttwo" :key="index">{{ item }}</span>
							</div>
							<div class="nodata" v-if="rilisttwo == ''">
								<!-- <span>暂无数据</span> -->
							</div>
						</div>
					</div>
				</div>


			</div>

		</div>
		<div  id="button"  ref="btns"></div>
		<!-- 绑定地址编号 -->
		<el-dialog
			title="绑定地址编号"
			:visible.sync="adressdialogVisible"
			width="30%"
			:before-close="handleClose">
			<el-input v-model="sn" placeholder="请输入地址编号"></el-input>
			<span slot="footer" class="dialog-footer">
				<el-button @click="adressdialogVisible = false">取 消</el-button>
				<el-button type="primary" @click="adressbtn">确 定</el-button>
			</span>
		</el-dialog>
		<!-- 绑定地址编号 -->

		<!-- 导入token提示弹窗 -->
		<el-dialog
			title="导入token"
			:visible.sync="tokendialogVisible"
			width="50%"
			:before-close="tokenhandleClose">
			<div class="popview">
				<div class="yixia">
					<span class="xianame">以下token无效,有问题请联系管理员</span>
					<span class="daochu" v-if="unable_use!=''" @click="getdaochu">导出这些token</span>
					<!-- <span class="daoqu">导出这些token</span> -->
				</div>
				<div class="tokenview">
					<div class="titem" v-for="(item,index) in unable_use" :key="index">
						<span class="tiname">{{item}}</span>
					</div>
				</div>
				<div class="yixia">
					<span class="xianame">以下token有效</span>
				</div>
				<div class="tokenview">
					<div class="titem" v-for="(item,index) in able_use" :key="index">
						<span class="twoname">{{item}}</span>
					</div>
				</div>
			</div>
			<span slot="footer" class="dialog-footer">
				<el-button @click="tokenhandleClose">取 消</el-button>
				<el-button type="primary" @click="exptoken">导入有效token</el-button>
			</span>
		</el-dialog>
		<!-- 导入token提示弹窗结束 -->
		<!-- 地址录入提示弹窗 -->
		<el-dialog
			title="绑定收货地址"
			:visible.sync="dizhidialogVisible"
			width="50%"
			:before-close="dizhihandleClose"
			z-index='1000000'
			>
			<el-form
				:model="adressinfo"
				status-icon
				label-position="left"
				label-width="0px"
				:rules="rules"
				ref="adressinfo"
				class="demo-ruleForm adpop"
				>
				<el-form-item prop="consignee">
					<span class="iname"><span class="xing">*</span>收货人</span>
					<el-input
					type="text"
					v-model="adressinfo.consignee"
					auto-complete="off"
					placeholder="请输入收货人"
					@change="changeone"
					>
					<span class="suiji" slot="suffix" @click="suiji(1)">随机</span>
				</el-input>
				</el-form-item>
				<el-form-item prop="mobile">
					<span class="iname"><span class="xing">*</span>电话(默认随机)</span>
					<el-input
					type="text"
					v-model="adressinfo.mobile"
					auto-complete="off"
					placeholder="请输入电话"
					@change="changeone"
					>
					<span class="suiji" slot="suffix" @click="suiji(2)">随机</span>
				</el-input>
				</el-form-item>
				<el-form-item prop="gongzuodizhi">
				<span class="iname"><span class="xing">*</span>请选择地区</span>
				<div>
					<el-select
					style="width: 32%"
					v-model="adressinfo.province"
					placeholder="请选择省级"
					@change="selectChanged_one"
				>
					<el-option
					v-for="item in ProvinceList"
					:key="item.name"
					:label="item.name"
					:value="item.id"
				></el-option>
				</el-select>
				<el-select
					style="width: 32%"
					v-model="adressinfo.city"
					placeholder="请选择市区"
					@change="selectChanged_two"
				>
				<el-option
					v-for="item in CityList"
					:key="item.name"
					:label="item.name"
					:value="item.id"
				></el-option>
				</el-select>
				<el-select
					style="width: 32%"
					v-model="adressinfo.district"
					placeholder="请选择区/县"
				>
					<el-option
					v-for="item in CountyList"
					:key="item.name"
					:label="item.name"
					:value="item.id"
				></el-option>
				</el-select>
				</div>
				</el-form-item>
				<el-form-item prop="address">
					<span class="iname"><span class="xing">*</span>详细地址</span>
					<el-input
					type="textarea"
					v-model="adressinfo.address"
					:autosize="{ minRows: 2, maxRows: 4}"
					auto-complete="off"
					placeholder="请输入详细地址"
					></el-input>
				</el-form-item>
				<el-form-item prop="zip">
					<span class="iname"><span class="xing">*</span>邮编</span>
					<el-input
					type="text"
					v-model="adressinfo.zip"
					auto-complete="off"
					placeholder="请输入邮编"
					></el-input>
				</el-form-item>
			</el-form>
			<span slot="footer" class="dialog-footer">
				<el-button @click="dizhihandleClose">取 消</el-button>
				<el-button type="primary" @click="dizhibtn" v-if="showflag">创建</el-button>
			</span>
		</el-dialog>
		<!-- 地址录入提示弹窗结束 -->

		  <!-- 公告弹窗 -->
		  <!-- <div class="first-gift-boxs" v-if="gongpopshow">
			<div class="content-box animated" :class="animat"  hover-class="bounce">
				<div class="popview">
					<text class="name">注销账号不可逆,请谨慎操作！</text>
					<text class="miao">请在下方输入<text class="hongzi">"确认注销"</text>再进行</text>
					<text class="miao"><text class="hongzi">"下一步"</text>注销操作</text>
					<input type="text" v-model="zhuxiaotext" placeholder="请输入确认注销" class="popinput">
					<div class="popbot">
						<div class="popbotitem left" :style="{ border: '0.5px solid'+acolor,color:acolor }" @click="xiayibu">下一步</div>
						<div class="popbotitem quxiao" :style="{ background: acolor }" @click="popquxiao">取消</div>
					</div>
				</div>
			</div>
		</div> -->
	</div>
</template>

<script>
import Trees from '@/components/elTree';
import { SystemMangeAPI } from "@/api/SystemMange";
import { baseAPI } from "@/api/base";
import { cpSync } from 'fs';
// let captcha;
// initAliyunCaptcha({
//     SceneId: '1udsszbp', // 场景ID。根据步骤二新建验证场景后，您可以在验证码场景列表，获取该场景的场景ID
//     prefix: '1cbeog', // 身份标。开通阿里云验证码2.0后，您可以在控制台概览页面的实例基本信息卡片区域，获取身份标
//     mode: 'popup', // 验证码模式。popup表示要集成的验证码模式为弹出式。无需修改
//     element: '#captcha-element', //页面上预留的渲染验证码的元素，与原代码中预留的页面元素保持一致。
//     button: '#button', // 触发验证码弹窗的元素。button表示单击登录按钮后，触发captchaVerifyCallback函数。您可以根据实际使用的元素修改element的值
//     captchaVerifyCallback: captchaVerifyCallback, // 业务请求(带验证码校验)回调函数，无需修改
//     onBizResultCallback: onBizResultCallback, // 业务请求结果回调函数，无需修改
//     getInstance: getInstance, // 绑定验证码实例函数，无需修改
//     slideStyle: {
//       width: 360,
//       height: 40,
//     }, // 滑块验证码样式，支持自定义宽度和高度，单位为px。其中，width最小值为320 px
//     language: 'cn', // 验证码语言类型，支持简体中文（cn）、繁体中文（tw）、英文（en）
//   });
//    // 绑定验证码实例函数。该函数为固定写法，无需修改
//    function getInstance(instance) {
// 	console.log('+++'+instance)
//     captcha = instance;
//   }

export default {
	name: 'OperationLog',
	components: {Trees,},
	data() {
		return {
			treeTitle: "组织架构",
			isshuju:false,
			form:{
				type:['7天无理由退货', '刷新黑名单', '退货包邮', '屏蔽同省商家'],
				mone:'1',
				mtwo:'4',
				mthree:'1',
				mfour:'4',
				mfive:'5',
				msix:'1',
				mseven:'5',
				meight:'1000',
				mnine:'0',
				mten:'店铺',
				hone:'随机sku',
				htwo:['随机修改名称'],
				hthree:['启用云代理'],
				nums:'2',
				name:'',
				region:'',
				resource:'',
				ntype:'拼多多'
			},
			jia:{
				min_price:'10',
				max_price:'60',
				token:'',
				type:'2',//1拼多多 2小红书
			},
			hindex:1,
			adressdialogVisible: false,
			tokendialogVisible:false,//导入token弹窗
			dizhidialogVisible:false,//地址弹窗
			sn:'',
			info:{},
			captcha:{},
			uploadImgUrl: this.$api+"/order/import", // 上传的图片服务器地址
			headers: {
				token: localStorage.getItem("authorization"),
			},
			uploaddata:{
				// id:'',
			},
			// able_use:['cc17e818-e427-41c4-845c-f6903f6624fb'],//有效token
			able_use:[],//有效token
			unable_use:[],//无效token
			list:
			[
					// {
					// 	"id": 3,
					// 	"user_id": 5,
					// 	"token": "cc17e818-e427-41c4-845c-f6903f6624fb",
					// 	"status": "0",
					// 	"type": "0",
					// 	"consignee": null,
					// 	"mobile": null,
					// 	"address": null,
					// 	"zip": null,
					// 	"province": 0,
					// 	"city": 0,
					// 	"district": 0,
					// 	"order_num": 0
					// }
					// {
					// 	"id": 3,
					// 	"user_id": 5,
					// 	"token": "cc17e818-e427-41c4-845c-f6903f6624fb",
					// 	"status": "0",
					// 	"type": "1",
					// 	"consignee": "吉群利",
					// 	"mobile": "14772544870",
					// 	"address": "百合花园",
					// 	"zip": "1234",
					// 	"province": 1,
					// 	"city": 2,
					// 	"district": 3,
					// 	"order_num": 0
					// }
			],
			adressinfo:{
				consignee:'',//收货人
				mobile:'',//电话
				province:'',//省id
				city:'',//市id
				district:'',//区id
				address:'',//地址
				zip:'',//邮编
				token:'',//token值
				type:0,//type：0=随机,1=真实
			},
			ssqinfo:'',//地址完整信息
			ProvinceList:[],//省数据
			CityList:[],//市数据
			CountyList:[],//区数据
			ProvinceId:'',//省id
			CityId:'',//市
			CountyId:'',//区id
			
			timer: null,
			time: 6,
			isTimer: false,
			lunnum:1,//初始循环次数
			rilist:[],//日志数据
			rilisttwo:[],//日志数据
			loadingbtn:false,
			listnums:0,
			listnumszong:0,
			timertwo: null,
			listtoken:'',
			popshow:false,
			istoken:'',
			listinfo:{
				order_num:null
			},
			listietm:{},//用于判断
			showflag:false,
			gongpopshow:false,
			isgetHome:false,//是否是地址过来

			tokennum:0,//下单数量
			loading:null,
			loadingRight:false,
			rtime:4,
			ltext:'正在设置独立IP',
			timerthree: null,
			// captcha: null,
      		// captchaButton: null,
		};
	},	
	watch: {
		// form(newVal, oldVal) {
		// 	console.log(newVal)
		// 	if (newVal == true) {
		// 	// this.initMap(39.90693,116.39757)
		// 	}
		// }
		// dizhidialogVisible(newVal, oldVal) {
		// 	console.log(newVal)
		// 	if (newVal) {
		// 		this.dizhidialogVisible = newVal
		// 	}
		// },
		// $route: {
		// 	handler: function(val, oldVal){
		// 	console.log(val);
		// 	console.log("____________")
		// 	},
		// 	// 深度观察监听
		// 	deep: true
		// }
	},
	mounted() {
		this.captchaButton = document.getElementById('captcha-button');

		initAliyunCaptcha({
			SceneId: '1spfr0wv', // 场景ID。根据步骤二新建验证场景后，您可以在验证码场景列表，获取该场景的场景ID
			prefix: 'u72qn1', // 身份标。开通阿里云验证码2.0后，您可以在控制台概览页面的实例基本信息卡片区域，获取身份标
			mode: 'popup', // 验证码模式。popup表示要集成的验证码模式为弹出式。无需修改
			element: '#captcha-element', //页面上预留的渲染验证码的元素，与原代码中预留的页面元素保持一致。
			button: '#button', // 触发验证码弹窗的元素。button表示单击登录按钮后，触发captchaVerifyCallback函数。您可以根据实际使用的元素修改element的值
			captchaVerifyCallback: this.captchaVerifyCallback, // 业务请求(带验证码校验)回调函数，无需修改
			onBizResultCallback: this.onBizResultCallback, // 业务请求结果回调函数，无需修改
			getInstance: this.getInstance, // 绑定验证码实例函数，无需修改
			slideStyle: {
			width: 360,
			height: 40,
			}, // 滑块验证码样式，支持自定义宽度和高度，单位为px。其中，width最小值为320 px
			language: 'cn', // 验证码语言类型，支持简体中文（cn）、繁体中文（tw）、英文（en）
		});
		this.$eventBus.$off("getHome")
		//eventBus使用注意事项: 在$on绑定事件之前先使用$off解绑事项。
		// 若不使用  this.$eventBus.$off("getData") 则页面重新进入时,
		//或造成内存泄漏,可以看到重新进入3次后,
		//执行 this.$eventBus.$emit()该方法是,$on会多次绑定,重复监听3次,
		//所以在每次$on接收到事件之前先解绑事件($off)
		let that = this
		this.$eventBus.$on("getHome",function(data){
			console.log('监听到变化首页',data)
			// 开始调用方法
			that.isgetHome = true
			if(localStorage.getItem("able_use")){
				// location.reload();
				// window.location.reload()
				that.able_use = JSON.parse(localStorage.getItem("able_use")).data
				// console.log(this.able_use)
				// this.showflag=false
				// this.dizhidialogVisible = true
				console.log(that.isgetHome)
				that.list =[]
				that.getList()
				// this.exptoken()
			}
		})
		
		this.getInfo()

		this.getProvinceList();//省列表
		// this.dizhidialogVisible = true
		// this.getmoren();//获取默认地址数据

		if(localStorage.getItem("able_use")){
			// location.reload();
			// window.location.reload()
			this.able_use = JSON.parse(localStorage.getItem("able_use")).data
			// console.log(this.able_use)
			// this.showflag=false
			// this.dizhidialogVisible = true
			// console.log(this.isgetHome)
			this.list =[]
			this.getList()
			// this.exptoken()
		}

		if(localStorage.getItem("form")){
			console.log(JSON.parse(localStorage.getItem("form")))
			this.form = JSON.parse(localStorage.getItem("form"))
			console.log(this.form)
		}

		if(localStorage.getItem("jia")){
			console.log(JSON.parse(localStorage.getItem("jia")))
			// console.log(JSON.parse(localStorage.getItem("form")))
			this.jia = JSON.parse(localStorage.getItem("jia"))
			// console.log(this.form)
		}
		
		
	},
	onHide() {
		console.log("页面隐藏")
       
	},
	beforeDestroy(){
		console.log("beforeDestroy")
		// const maskelement = document.getelementById('aliyuncaptcha-mask');
		// console.log(maskelement)
		document.getElementById('aliyunCaptcha-mask').remove();
		document.getElementById('aliyunCaptcha-window-popup').remove();
		// const captchaElement = document.getElementById('aliyunCaptcha-window-popup');
		// if(captchaElement){
		// 	document.getElementById('aliyunCaptcha-window-popup').remove();
		// }
	},
	beforeUnmount() {
		console.log("beforeUnmount")
		this.captchaButton = null;

		// 必须删除相关元素，否则再次mount多次调用 initAliyunCaptcha 会导致多次回调 captchaVerifyCallback
		document.getElementById('aliyunCaptcha-mask').remove();
		document.getElementById('aliyunCaptcha-window-popup').remove();
	},
	methods: {
		captchaVerifyCallback(captchaVerifyParam) {
			// 1.向后端发起业务请求，获取验证码验证结果和业务结果
			SystemMangeAPI
			.captcha({
				captcha:captchaVerifyParam,
				// token:this.listtoken
				token:localStorage.getItem("listtoken")||''
			})
			.then((res) => {
				console.log(JSON.stringify(res))
				// console.log(this.listinfo)
				if(res.code == 1){
					this.$message({
						type: "success",
						message: res.msg,
					});
					this.popshow = false
					// this.$refs.close.click()
					// console.log(this.captcha)
					// this.captcha
					
					document.getElementById('aliyunCaptcha-btn-refresh').click()
					document.getElementById('aliyunCaptcha-btn-close').click()
					// this.listinfo = item
					// console.log(this.listinfo.province)
					console.log(localStorage.getItem("listinfo"))
					let listinfo = JSON.parse(localStorage.getItem("listinfo"))
					listinfo.status = 1
					localStorage.setItem("listinfo",JSON.stringify(listinfo))
					console.log(localStorage.getItem("listtoken"))
					console.log(listinfo.province)
					if(listinfo.province != 0){
						this.rilist = []
						this.rilisttwo = []//清除控制台数据
						this.jia.token = localStorage.getItem("listtoken")||''//this.listtoken
						this.isshuju = true
						this.hindex = 1
						localStorage.setItem("istoken",localStorage.getItem("listtoken")||'')
						// this.getList(2)
					}else if(listinfo.province == 0||listinfo.province == '0'||listinfo.district == 0){
						console.log("开启地址弹窗")
						// location.reload();
						// this.getList(2)
						this.adressinfo.token =listinfo.token
						this.jia.token = listinfo.token
						
						this.getProvinceList();//省列表
						this.getmoren();//获取默认地址数据
						this.getdakai();
						localStorage.setItem("istoken",'')
						// this.dizhidialogVisible = false
						// let _this = this;
						// setTimeout(function() {
						// 	_this.dizhidialogVisible = true
						// 	console.log(_this.dizhidialogVisible)
						// }, 500);
						
						
					}
					this.getList(2)
					
					// document.getElementById('captcha-element').style.display="none";
					
					// console.log(result.captchaVerifyResult)
					// // 2.构造标准返回参数
					// const verifyResult = {
					// captchaResult: true, // 验证码验证是否通过，boolean类型，必选
					// bizResult:true
					// // bizResult: 从result获取您的业务验证结果, // 业务验证是否通过，boolean类型，可选；若为无业务验证结果的场景，bizResult可以为空
					// };

					// // console.log(verifyResult)
					// return captchaVerifyParam;
					// return {
					// 	captchaResult: true,
					// 	// bizResult: true,
					// }
				}else{
					document.getElementById('aliyunCaptcha-btn-refresh').click()
					// document.getElementById('aliyunCaptcha-btn-close').click()
				}
				
			})
			// const result = xxxx('http://您的业务请求地址', {
			// 	captchaVerifyParam: captchaVerifyParam, // 验证码参数
			// 	// yourBizParam... // 业务参数
			// });

			
		},
		onBizResultCallback(bizResult) {
			console.log(bizResult)
			if (bizResult === true) {
			// 如果业务验证通过，跳转到对应页面。此处以跳转到https://www.aliyun.com/页面为例
			// window.location.href = 'https://www.aliyun.com/';
			} else {
			// 如果业务验证不通过，给出不通过提示。此处不通过提示为业务验证不通过！
			// alert('业务验证不通过！');
			}
		},
		getInstance(instance) {
			// console.log('++++')
			console.log(instance)
			this.captcha = instance;
			// console.log(this.captcha)
			// console.log(this.captcha.button)
		},

		getInfo(){
            baseAPI.userinfo().then((res =>{
				if(res.code == 1){
					this.info = res.data
					if(this.info.area_id == 0){
						//绑定地址组件
						this.adressdialogVisible = true
					}else{
						this.sn = this.info.area_id
					}
				}
				
			}))
		},
		//TODO:初始化页面 -- 刷新页面
		initData() {
			this.getData();
			 
		},
		//SystemMangeAPI
        getData() {
		    SystemMangeAPI
			.userinfo()
			.then((res) => {
				// console.log(res)
			})
		},
		yidu(){
		  SystemMangeAPI
			.yijianchuliXiaoxi()
			.then((res) => {
				this.$message({
					type: "success",
					message: res.msg,
				});
				this.getData();
				this.$store.dispatch("user/resetOrder", 'xiaoxi').then((res) => {
				})
			})
		},
		yiduciye(){//已读次页
			SystemMangeAPI
			.yiduciye({
				page:this.queryParams.page,
				rows:this.queryParams.rows
			})
			.then((res) => {
				this.$message({
					type: "success",
					message: res.msg,
				});
				this.getData();
				this.$store.dispatch("user/resetOrder", 'xiaoxi').then((res) => {
				})
			})
		},
		toogleExpand(row,type){
			this.$router.push({
				path: "./shifulist",
				query: {id: row.shifuId}
			});
		},
		adressbtn(){
			//绑定地址编号
			if(!this.sn){
				this.$message({
					type: "error",
					message: '请输入地址编号',
				});
				return false;
			}
			
			SystemMangeAPI.setAddrSn({
				sn:this.sn
			})
			.then((res) => {
				if(res.code == 1){
					this.$message({
						type: "success",
						message: res.msg,
					});
					this.adressdialogVisible = false
				}
			})
		},
		handleUploadSuccess(response, file, fileList) {
		console.log(file.response.data)
		if(file.response.data.unable_use == ''){
			this.able_use = file.response.data.able_use
			this.unable_use = file.response.data.unable_use
			this.hindex = 2
			this.exptoken()
		}else{
			this.able_use = file.response.data.able_use
			this.unable_use = file.response.data.unable_use
			this.tokendialogVisible = true
			this.hindex = 2
		}
		
		// this.editParams.toxiangmian = file.response.data
		// this.$emit("input", file.response.data);
		},
		tokenhandleClose(){
			this.tokendialogVisible = false
			this.hindex = 1
		},
		 // 限制图片上传大小
		 beforeAvatarUpload(file) {
			// const isLt2M = file.size / 1024 / 1024 < 10
			// if (!isLt2M) {
			// 	this.$message.error('大小不能超过 10MB!')
			// }
			// return isLt2M
		},
		exptoken(){
			//导入token
			SystemMangeAPI
			.ordervalid({
				tokens:this.able_use
			})
			.then((res) => {
				console.log(res)
				if(res.code == 1){
					if(!localStorage.getItem("able_use")){
						this.$message({
							type: "success",
							message: res.msg,
						});
					}
					this.tokendialogVisible = false
					this.dizhidialogVisible = false
					//请求数据列表
					this.getList()
					
					let shuju = {}
					shuju.data = this.able_use
					localStorage.setItem("able_use",JSON.stringify(shuju))
					// console.log(JSON.parse(localStorage.getItem("able_use")))
				}
			})
		},
		blur(e){
			// console.log(e)
			localStorage.setItem("jia",JSON.stringify(this.jia))
			console.log(JSON.parse(localStorage.getItem("jia")))
		},
		getList(e){
			// console.log(this.able_use)
			SystemMangeAPI
			.useraccount({
				tokens:this.able_use
			})
			.then((res) => {
				console.log(res)
				if(res.code == 1){
					this.list = res.data
					localStorage.setItem("homelist",JSON.stringify(this.list))
					localStorage.setItem("form",JSON.stringify(this.form))
					localStorage.setItem("jia",JSON.stringify(this.jia))
					console.log(localStorage.getItem("istoken"))
					
					
					if(localStorage.getItem("istoken")){
						this.istoken = localStorage.getItem("istoken")
						// console.log(this.istoken)
						this.jia.token =this.istoken
						// this.listtoken = this.istoken
						this.isshuju = true
						this.hindex = 1
						this.getokennum(this.jia.token)
					}
					// 弹出式
					console.log( this.captcha)
					// document.getElementById('aliyunCaptcha-mask').remove();
					// document.getElementById('aliyunCaptcha-window-popup').remove();
					this.captcha = {}
					if(e != 2){
						console.log(this.captcha)
						// initAliyunCaptcha({
						// 	SceneId: '1udsszbp', // 场景ID。根据步骤二新建验证场景后，您可以在验证码场景列表，获取该场景的场景ID
						// 	prefix: '1cbeog', // 身份标。开通阿里云验证码2.0后，您可以在控制台概览页面的实例基本信息卡片区域，获取身份标
						// 	mode: 'popup', // 验证码模式。popup表示要集成的验证码模式为弹出式。无需修改
						// 	element: '#captcha-element', //页面上预留的渲染验证码的元素，与原代码中预留的页面元素保持一致。
						// 	button: '#button', // 触发验证码弹窗的元素。button表示单击登录按钮后，触发captchaVerifyCallback函数。您可以根据实际使用的元素修改element的值
						// 	captchaVerifyCallback: this.captchaVerifyCallback, // 业务请求(带验证码校验)回调函数，无需修改
						// 	onBizResultCallback: this.onBizResultCallback, // 业务请求结果回调函数，无需修改
						// 	getInstance: this.getInstance, // 绑定验证码实例函数，无需修改
						// 	slideStyle: {
						// 	width: 360,
						// 	height: 40,
						// 	}, // 滑块验证码样式，支持自定义宽度和高度，单位为px。其中，width最小值为320 px
						// 	language: 'cn', // 验证码语言类型，支持简体中文（cn）、繁体中文（tw）、英文（en）
						// });
						// console.log(this.captcha)
						this.popshow = true
					}
					// console.log(this.isgetHome)
					if(this.isgetHome){
						let listinfo = JSON.parse(localStorage.getItem("listinfo"))
						console.log(listinfo)
						if(listinfo){
							// this.listClick(listinfo)
							if(listinfo.status == 1&& listinfo.province != 0){
								console.log("已经完全验证")
								this.rilist = []
								this.rilisttwo = []//清除控制台数据
								this.listinfo = listinfo
								// localStorage.setItem("listinfo",JSON.stringify(item))
								// console.log(this.listinfo)
								this.jia.token = listinfo.token
								this.isshuju = true
								this.hindex = 1
								// console.log(this.isshuju)
								this.$forceUpdate()
								// this.$alert('检测数据有更新,点击确定更新', '提示', {
								// 	confirmButtonText: '确定',
								// 	callback: action => {
								// 		// location.reload()
								// 		this.rilist = []
								// 		this.rilisttwo = []//清除控制台数据
								// 		this.listinfo = listinfo
								// 		// localStorage.setItem("listinfo",JSON.stringify(item))
								// 		// console.log(this.listinfo)
								// 		this.jia.token = listinfo.token
								// 		this.isshuju = true
								// 		this.hindex = 1
								// 		console.log(this.isshuju)
								// 		this.$forceUpdate()
								// 	}
								// 	});
							}
						}
					}
					
					// let listtoken = localStorage.getItem("listtoken")
					// let newlist = this.list
					// console.log(newlist)
					// for(let i in newlist){
					// 	if(newlist[i].token == listtoken){
					// 		if(newlist[i].province == 0){
					// 			console.log("地址为空")
					// 			this.$refs.btns.click()
					// 			this.dizhidialogVisible = true
					// 		}
					// 	}
					// }
					
					// if(e == 2){
					// 	document.getElementById('captcha-element').style.display="none";
					// }
					
				}
			})
		},
		listClick(item){
			console.log(item)
			//点击列表 "status": "1", //状态:0=未验证,1=已验证
			if(item.status == 0){
				//未验证
				// this.showflag=true
				// this.dizhidialogVisible = true
				// return;
				this.listtoken = item.token
				localStorage.setItem("listtoken",item.token)
				// localStorage.setItem("listinfo",item)
				// let listinfoshuju = {}
				// listinfoshuju.data = item
				localStorage.setItem("listinfo",JSON.stringify(item))
				
				console.log(localStorage.getItem("listtoken"))
				this.listinfo = item
				// console.log(this.listinfo)
				
				// document.getElementById('aliyunCaptcha-btn-refresh').click()
				console.log(this.$refs.btns)
				// this.$refs.btns.click()
				// document.getElementById('aliyunCaptcha-btn-refresh').click()
				this.isshuju = false //控制台隐藏
				this.hindex = 1 //步骤变成导入账号
				localStorage.setItem("istoken",'')
				this.showflag=false

				// if(item.province == 0){
				// 	//地址弹窗出现
				// 	this.adressinfo.token = item.token
				// 	this.jia.token = item.token
				// 	this.dizhidialogVisible = true
				// 	this.getProvinceList();//省列表
				// 	this.getmoren();//获取默认地址数据
				// }
				// let _this = this;
				// setTimeout(function() {
				// 	closeLoading();
				// }, 500);


				this.popshow = false
				// this.$refs.close.click()
				// console.log(this.captcha)
				// this.captcha
				
				// document.getElementById('aliyunCaptcha-btn-refresh').click()
				// document.getElementById('aliyunCaptcha-btn-close').click()
				// this.listinfo = item
				// console.log(this.listinfo.province)
				console.log(localStorage.getItem("listinfo"))
				let listinfo = JSON.parse(localStorage.getItem("listinfo"))
				listinfo.status = 1
				localStorage.setItem("listinfo",JSON.stringify(listinfo))
				console.log(localStorage.getItem("listtoken"))
				console.log(listinfo.province)
				if(listinfo.province != 0){
					this.rilist = []
					this.rilisttwo = []//清除控制台数据
					this.jia.token = localStorage.getItem("listtoken")||''//this.listtoken
					this.isshuju = true
					this.hindex = 1
					localStorage.setItem("istoken",localStorage.getItem("listtoken")||'')
					// this.getList(2)
				}else if(listinfo.province == 0||listinfo.province == '0'||listinfo.district == 0){
					console.log("开启地址弹窗")
					// location.reload();
					// this.getList(2)
					this.adressinfo.token =listinfo.token
					this.jia.token = listinfo.token
					
					this.getProvinceList();//省列表
					this.getmoren();//获取默认地址数据
					this.getdakai();
					localStorage.setItem("istoken",'')
					// this.dizhidialogVisible = false
					// let _this = this;
					// setTimeout(function() {
					// 	_this.dizhidialogVisible = true
					// 	console.log(_this.dizhidialogVisible)
					// }, 500);
					
					
				}
				this.getList(2)
			}else if(item.province == 0){
				//地址弹窗出现
				this.adressinfo.token = item.token
				this.jia.token = item.token
				this.showflag=true
				this.$router.push('/orderdetail');
				// this.dizhidialogVisible = true
				// this.getProvinceList();//省列表
				// this.getmoren();//获取默认地址数据
				this.listinfo = item
				localStorage.setItem("listinfo",JSON.stringify(item))
				this.isshuju = false
				this.hindex = 1
				localStorage.setItem("istoken",'')
			}else{
				this.rilist = []
				this.rilisttwo = []//清除控制台数据
				this.listinfo = item
				localStorage.setItem("listinfo",JSON.stringify(item))
				console.log(this.listinfo)
				this.jia.token = item.token
				this.getokennum(this.jia.token)
				this.isshuju = true
				this.hindex = 1
				localStorage.setItem("istoken",item.token)

				this.getloading();//右侧倒计时
				// console.log(localStorage.getItem("istoken"))
				// if(localStorage.getItem("able_use")){

				// }
			}
		},
		getloading(){
			let that = this
			// this.rilisttwo.push(this.rilist[this.listnumszong])
			// console.log(this.rilisttwo)
			this.loadingRight = true
			if(this.rtime == 4){
				this.ltext = '正在设置独立IP'
			}else if(this.rtime == 3){
				this.ltext = '正在随机修改昵称'
			}else if(this.rtime == 2){
				this.ltext = '正在筛选商品'
			}else if(this.rtime == 1){
				this.ltext = '正在刷新黑名单'
			}else{
				this.ltext = '正在设置独立IP'
			}
			if (Number(this.rtime) <= 0) {
				console.log("倒计时结束")
				clearInterval(this.timerthree);
				this.rtime = 4
				this.loadingRight = false
				return false;
			}
			that.timerthree = setTimeout(() => {
				if (Number(this.rtime) > 0 ) {
					this.rtime--
					that.getloading()
				}
			}, 1000);
		},
		dizhihandleClose(){
			//地址关闭事件
			console.log('关闭事件')
			this.dizhidialogVisible = false
			this.adressinfo={
				consignee:'',//收货人
				mobile:'',//电话
				province:'',//省id
				city:'',//市id
				district:'',//区id
				address:'',//地址
				zip:'',//邮编
			}
		},
		getmoren(){
			// this.suiji(1);
			// this.suiji(2);
			
			SystemMangeAPI.addressdefault().then((res) => {
					if(res.code == 1){
						this.adressinfo.consignee = res.data.consignee
						this.adressinfo.mobile = res.data.mobile
						this.adressinfo.province = res.data.area.province
						this.adressinfo.city = res.data.area.city
						this.ProvinceId = res.data.area.province
						this.CityId = res.data.area.city
						this.getCityList();//获取市
						this.CountyId = res.data.area.district
						this.getCountList();//获取市
						this.adressinfo.district = res.data.area.district
						this.adressinfo.zip = res.data.area.zip
						this.adressinfo.address = res.data.area.address
						this.adressinfo.type = 0
					}
			});
		},
		changeone(e){
			console.log("+++")
			console.log(e)
			this.adressinfo.type = 1
		},

		// 省市区方法开始
		getProvinceList(){ //获取省
			baseAPI.province().then((res) => {
				// console.log(res)
				this.ProvinceList = res.data
			});
		},
		selectChanged_one(value) {
			console.log(value)
			this.ProvinceId = value
			this.CityId=''
			this.CountyId=''
			this.adressinfo.province = value
			this.adressinfo.city = ''
			this.adressinfo.district = ''
			this.getCityList();//获取市
		},
		getCityList(){ //获取市
			baseAPI.areacity({provice_id:this.ProvinceId}).then((res) => {
				this.CityList = res.data
			});
		},
		selectChanged_two(value){
			console.log(value)
			this.CityId = value
			this.CountyId=''
			this.adressinfo.city = value
			this.adressinfo.district = ''
			this.getCountList();//获取市
		},
		getCountList(){//所有区
			baseAPI.areadistrict({area_id:this.CityId}).then((res) => {
					this.CountyList = res.data
			});
		},
		selectChanged_three(value){
		this.CountyId = value
		},
		suiji(e){
			if(e == 1){
				//收货人
				SystemMangeAPI.addressrand({type:0}).then((res) => {
						if(res.code == 1){
							this.adressinfo.consignee = res.data
						}
				});
			}else if(e == 2){
				//电话
				SystemMangeAPI.addressrand({type:1}).then((res) => {
						if(res.code == 1){
							this.adressinfo.mobile = res.data
						}
				});
			}
		},
		// 省市区方法结束
		dizhibtn(){
			// console.log(this.adressinfo)
			let adressinfo = this.adressinfo
			let status = true
			for(let i in adressinfo){
				// console.log(adressinfo[i])
				console.log(i)
				if(adressinfo[i] == '' && i!='type'){
					status = false
				}
			}
			if(status){
				// console.log("地址成功")
			}else{
				this.$message({
					type: "error",
					message: '请完善地址信息',
				});
				return false;
			}
			SystemMangeAPI.orderaddress(this.adressinfo).then((res) => {
					if(res.code == 1){
						this.$message({
							type: "success",
							message: res.msg,
						});
						this.dizhidialogVisible = false
						this.isshuju = true
						this.getList()
					}
					
			});
		},
		xiadanone(){
			
			this.rilist = []
			this.rilisttwo = []
			this.xiadan()
		},
		xiadan(){
			//开始下单
			
			let nums = Number(this.form.nums) // 下单数量
			// console.log(nums)
			// ordercreate
			let that = this
			// if(this.form.ntype=='拼多多'){
			// 	this.jia.type ='1'
			// }else if(this.form.ntype=='小红书'){
			// 	this.jia.type ='2'
			// }
			SystemMangeAPI.ordercreate(this.jia).then((res) => {
					if(res.code == 1){
						// this.loadingbtn = true
						
						
						this.rilist = [...this.rilist, ...res.data];
						// console.log(this.rilist)
						if (Number(this.lunnum) >= nums) {
							// console.log("倒计时结束")
							this.isTimer = false;
							clearInterval(this.timer);
							// this.loadingbtn = false
							
							this.lunnum = 1
							this.getshulist();//渲染最后数据
							return false;
						}
						that.timer = setTimeout(() => {
							// console.log("执行+++++"+this.lunnum)
							// this.time--
							if (Number(this.lunnum) <= nums) {
								this.lunnum++
								// this.$message('这是一条消息提示');
								that.xiadan()
							}
						}, 1000);
					}else if(res.code == 0){
						this.rilist = [...this.rilist, ...res.data];
						this.isTimer = false;
						// console.log(this.rilist)
						// console.log("code0-----停止")
						// this.loadingbtn = false
						this.lunnum = 1
						this.getshulist();//渲染最后数据
						clearInterval(this.timer);
						return false;
					}
					
			});
		},
		getshulist(){
			// let loading;
			// console.log(this.rilist.length)
			this.loading = this.$loading({
				lock: true,
				text: '自动下单中，禁止其他操作',
				spinner: 'el-icon-loading',
				background: 'rgba(0, 0, 0, 0)'
			});
			// if(this.listnumszong == 1){
			// 	this.loading.setText('正在设置独立IP')
			// }else if(this.listnumszong == 2){
			// 	this.loading.setText('正在随机修改昵称')
			// }else if(this.listnumszong == 3){
			// 	this.loading.setText('正在筛选商品')
			// }else if(this.listnumszong == 4){
			// 	this.loading.setText('正在刷新黑名单')
			// }else if(this.listnumszong == 5){
			// 	this.loading.setText('正在设置独立IP')
			// }else if(this.listnumszong == 6){
			// 	this.loading.setText('正在随机修改昵称')
			// }else if(this.listnumszong == 7){
			// 	this.loading.setText('正在筛选商品')
			// }else if(this.listnumszong == 8){
			// 	this.loading.setText('正在刷新黑名单')
			// }else if(this.listnumszong == 9){
			// 	this.loading.setText('正在设置独立IP')
			// }else if(this.listnumszong == 10){
			// 	this.loading.setText('正在随机修改昵称')
			// }else if(this.listnumszong == 11){
			// 	this.loading.setText('正在筛选商品')
			// }else if(this.listnumszong == 12){
			// 	this.loading.setText('正在刷新黑名单')
			// } else{
			// 	this.loading.setText('自动下单中，禁止其他操作')
				
			// }
			// this.loading.setText('测试'+this.listnumszong)
			// console.log(this.$refs.returnTop.scrollTop)
			// this.$refs.returnTop.scrollTop = this.$refs.returnTop.scrollTop+30
			var div = document.getElementById("myDiv");
			console.log(div.scrollHeight)
			// 将 div 元素滚动到底部
			div.scrollTo(0, div.scrollHeight);

			this.loadingbtn = true
			this.listnums = this.rilist.length
			let that = this
			// let nums = 0
			this.rilisttwo.push(this.rilist[this.listnumszong])
			// console.log(this.rilisttwo)
			if (Number(this.listnumszong) >= this.listnums) {
				console.log("倒计时结束")
				this.loading.close();
				this.loadingbtn = false
				this.getokennum(this.jia.token)
				clearInterval(this.timertwo);
				this.listnumszong = 0
				return false;
			}
			that.timertwo = setTimeout(() => {
				// console.log("执行+++++"+this.listnumszong)
				// this.time--
				
				if (Number(this.listnumszong) <= this.listnums) {
					this.listnumszong++
					that.getshulist()
				}
			}, 500);
		},
		scroll(e){
			let scrollBottom = e.target.scrollHeight - e.target.scrollTop - e.target.clientHeight;
			if(scrollBottom < 10){
			console.log("滚动条到底了")
			}
		},
		getdaoru(){
			this.list = []
			this.hindex = 1
			this.isshuju = false
			localStorage.setItem("homelist",'')
			localStorage.setItem("able_use",'')
			localStorage.setItem("istoken",'')
			localStorage.setItem("listtoken",'')
			localStorage.setItem("listinfo",'')
			this.czhi()
			localStorage.setItem("form",JSON.stringify(this.form))
			localStorage.setItem("jia",JSON.stringify(this.jia))
		},
		getdakai(){
			console.log("打开地址弹窗")
			this.showflag=true
			// this.$alert('这是一段内容', '标题名称', {
			// 	confirmButtonText: '确定',
			// 	callback: action => {
			// 		// this.$message({
			// 		// type: 'info',
			// 		// message: `action: ${ action }`
			// 		// });
			// 		console.log(action)
			// 		this.dizhidialogVisible = true
			// 		console.log(this.dizhidialogVisible)
			// 		this.$forceUpdate()
			// 	}
			// 	});
			// this.dizhidialogVisible = false
			this.gongpopshow = true
			this.dizhidialogVisible = true
			this.$router.push('/orderdetail');
			console.log(this.dizhidialogVisible)
			// this.$nextTick(() => {
			// 	this.dizhidialogVisible = true
			// 	this.$forceUpdate()
			// })
			
		},
		close(e){
			console.log(e)
		},
		getokennum(token){
			// tokennum
			SystemMangeAPI.getOrderNum({
				token:token
			}).then((res) => {
				console.log(res)
				if(res.code == 1){
					this.tokennum = res.data

				}
				
			})
		},
		getdaochu(){
				// let url = 'http://8.218.169.105/uploads/import/20231109/7c57f4cfd6ed6bc822eeffa1cd17b2e7.txt'
				// window.open(url);
				// const fileUrl = 'http://8.218.169.105/uploads/import/20231109/7c57f4cfd6ed6bc822eeffa1cd17b2e7.txt'
				// const fileName = `我下载的文件名称`;
				// const a = document.createElement('a');
				// a.href = fileUrl;
				// a.download = fileName;
				// document.body.appendChild(a);
				// a.click();
				// document.body.removeChild(a);
				this.$message({
					type: "success",
					message:"导出成功,请在文件内查看",
				});
				this.exportText(this.unable_use.toString())
				// SystemMangeAPI.export({
				// 	tokens:this.unable_use
				// }).then((res) => {
				// 	console.log(res)
				// 	this.exportText(this.unable_use.toString())
				// 	// window.open(res.data);
				// });
			},
			exportText (dataStr) {
				console.log(dataStr)
				dataStr = dataStr.replace(/,/g, '\n')
				console.log(dataStr)
				const name = "失效token";
				const element = document.createElement('a')
				element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(dataStr))
				element.setAttribute('download', name)
				element.style.display = 'none'
				element.click()
			},
			handleCheckedCitiesChange(e){
				console.log(e)
				console.log(e[0])
				if(e[0] == '启用云代理'){
					this.$message({
						type: "success",
						message:"IP已切换",
					});
				}else{
					this.$message({
						type: "success",
						message:"IP已切换",
					});
				}
				localStorage.setItem("form",JSON.stringify(this.form))
			},
			czhi(){
				//重置操作
				this.form ={
					type:['7天无理由退货', '刷新黑名单', '退货包邮', '屏蔽同省商家'],
					mone:'1',
					mtwo:'4',
					mthree:'1',
					mfour:'4',
					mfive:'5',
					msix:'1',
					mseven:'5',
					meight:'1000',
					mnine:'0',
					mten:'店铺',
					hone:'随机sku',
					htwo:['随机修改名称'],
					hthree:['启用云代理'],
					nums:'2',
					name:'',
					region:'',
					resource:'',
					ntype:'拼多多'
				}
				this.jia = {
					min_price:'10',
					max_price:'60',
					token:'',
					type:'2'
				}
				localStorage.setItem("form",JSON.stringify(this.form))
				localStorage.setItem("jia",JSON.stringify(this.jia))
			}

	}
};
</script>

<style scoped>
.zhuti{
	color: red;
	cursor: pointer;
}
.page-containerstwo{
	display: flex;
	flex-direction: row;

}
.neirong{
	white-space:nowrap;

	overflow:hidden;

	text-overflow:ellipsis;
}
.leftview{
	height: calc(100vh - 60px);
	background-color: #fff;
	width: 190px;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
}
.litem{
	width: 70%;
	height: 130px;
	border: 1px dotted #ddd;
	background-color: #eee;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	border-radius: 3px;
	cursor: pointer;
}
.pname{
	color: #fb333e;
	font-size: 14px;
	font-weight: 400;
	display: block;
	margin-top: 8px;
}
.rightview{
	flex: 1;
	min-height: calc(100vh - 60px);
	position: relative;
	display: flex;
	flex-direction: row;
}
.rview{
	display: flex;
	flex-direction: column;
	width: 100%;
	align-items: center;
	justify-content: center;
	justify-content: center;
	margin-top: 30%;
	
}
.rbuzhou{
	position: absolute;
	left: 20px;
	top: 20%;
	height: 300px;
}
.ltit{
	height: 60px;
	display: flex;
	flex-direction: row;
	align-items: center;
	color: #333;
	font-size: 14px;
	margin-left: 15px;
}
.zhanglist{
	max-height: 80vh;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	width: 100%;

}
.twoitem .leftview{
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: flex-start;
	/* padding: 0 15px; */
}
.zhangitem{
	display: flex;
	flex-direction: row;
	align-items: center;
	padding: 10px 15px;
	cursor: pointer;
}
.xuhao{
	padding: 2px 5px;
	color: #fff;
	background-color: #000;
	border-radius: 50%;
	min-width: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-right: 6px;
}
.xunum{
	display: inline-block;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	color: #333;
	font-size: 12px;
	font-weight: 400;
	max-width: 80%;
}
.rhone{
	width: 350px;
	height: 100%;
	margin-left: 20px;
	margin-top: 20px;
	/* padding: 20px; */
	
}
.rhtwo{
	width: 600px;
	height: 100%;
	/* padding: 20px; */
	margin-top: 20px;
	margin-left: 30px;
	margin-right: 15px;
}
.dangqian{
	color: #fb333e;
	font-size: 12px;
	font-weight: 400;
	display: block;
	margin-bottom: 10px;
	height: 20px;
}
.rhonediv{
	display: flex;
	flex-direction: column;
	width: 100%;
	background-color: #fff;
	border-radius: 5px;
}
.rhonedivone{
	border-bottom: 1px solid #eee;
	padding: 10px 10px;
	display: flex;
	flex-direction: row;
	align-items: center;
	margin-bottom: 10px;
}
.daifu{
	color: #333;
	font-size: 15px;
	font-weight: 500;
}
.daitong{
	color: #333;
	font-size: 13px;
	font-weight: 400;
}
.quan{
	width: 10px;
	height: 10px;
	border-radius: 50%;
	display: inline-block;
	margin-left: 5px;
	background-color: green;
}
.ml{
	margin-left: auto;
}
.rhonedivtwo{
	display: flex;
	flex-direction: column;
	padding: 15px;
}

.ditem{
	display: flex;
	flex-direction: column;
	margin-bottom: 15px;
}
.ditemtwo{
	display: flex;
	flex-direction: row;
	align-items: center;
	margin-bottom: 15px;
}

.blei{
	color: #333;
	font-size: 13px;
	font-weight: 400;
	margin-bottom: 10px;
}
.rowitem{
	display: flex;
	flex-direction: row;
	align-items: center;
}
.miaodan{
	font-size: 13px;
	font-weight: 400;
	color: #666;
	display: inline-block;
	margin-left: 5px;
}
.guai{
	font-size: 13px;
	font-weight: 400;
	color: #666;
	display: inline-block;
	margin: 0 6px;
}
.mt{
	margin-top: 13px;
}
.liuname{
	white-space: nowrap;
	font-size: 13px;
	font-weight: 400;
	color: #666;
	margin-right: 5px;
}
.yunlist{
	max-height: 500px;
	overflow-y: auto;
	position: relative;
}
.rizhi{
	display: block;
	/* overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis; */
	color: #333;
	font-size: 12px;
	font-weight: 400;
	max-width: 100%;
	padding: 8px 0;
}

/* 弹窗样式 */
.popview{
	max-height: 400px;
	border: 1px dashed #eee;
	width: 100%;
	min-height: 250px;
	overflow-y: scroll;
	padding: 20px;

}
.xianame{
	color: #333;
	font-size: 14px;
	font-weight: 400;
}
.yixia{
	display: flex;
	flex-direction: row;
	align-items: center;
}
.daoqu{
	padding: 4px 10px;
	border: 1px solid #eee;
	border-radius: 5px;
	color: #333;
	font-size: 13px;
	font-weight: 400;
	margin-left: 10px;
}
.tokenview{
	display: flex;
	flex-direction: column;
	border-bottom: 1px solid #eee;
	padding-bottom: 20px;
	margin-bottom: 20px;
}
.tokenview:last-child{
	border-bottom: none;
}
.titem{
	display: flex;
	flex-direction: row;
	align-items: center;
}
.tiname{
	padding: 10px 0;
	color: #fb333e;
	background-color: rgba(251, 51, 62,0.2);
	display: flex;
	flex-direction: row;
	width: auto;
	padding: 2px 6px;
	margin-top: 8px;
	border-radius: 5px;
}
.twoname{
	padding: 10px 0;
	color: #3250fb;
	background-color: rgba(50, 80, 251,0.2);
	display: flex;
	flex-direction: row;
	width: auto;
	padding: 2px 6px;
	margin-top: 8px;
	border-radius: 5px;
}
/* 弹窗样式结束 */
.xing{
	color: #fb333e;
}
.suiji{
	color: #333;
	font-size: 13px;
	display: inline-block;
	margin-right: 8px;
	cursor: pointer;
}
.nodata{
	min-height: 500px;
	display: flex;
	align-items: center;
	justify-content: center;
}
.nodata span{
	color: #666;
	font-weight: 400;
	font-size: 15px;
}
.daoru{
	padding: 5px 10px;
	border: 1px solid #eee;
	color: #333;
	font-size: 12px;
	background-color: #fff;
	position: fixed;
	right: 20px;
	top: 80px;
	z-index: 10;
	cursor: pointer;
	border-radius: 5px;
}
.listactive{
	background-color: rgba(251, 51, 62,0.1);
}

.first-gift-boxs{
	position: fixed;
	top: 0;
	left: 0;
	background-color: rgba(0,0,0,0.4);
	width: 100%;
	height: 100%;
	z-index: 200;
	display: flex;
	justify-content: center;
	align-items: center;
	flex-direction: column;
	transform: translate3D(0px, 0px, 0px) !important;

}
/* .content-box{
		position: relative;
		border-radius: 10px;
		width: 600rpx;
		background-size: 100% 100%;
		background-color: #fff;
		
	}
	.popview{
            width: 100%;
            min-height: 500rpx;
            background-color: #fff;
            border-radius: 25rpx;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 40rpx 30rpx;
           

        }
		.name{
                font-weight: 500;
                font-size: 32rpx;
                color: #333;
                display: block;
                margin-bottom: 25rpx;
            }
            .miao{
                color: #666;
                font-size: 26rpx;
                display: block;
                margin-bottom: 8rpx;

            }
            .hongzi{
                color: red;
                display: inline-block;
                margin: 0 3rpx;
                font-weight: 500;
            }
            .popinput{
                height: 80rpx;
                width: 100%;
                border: 1rpx solid #eee;
                text-align: center;
                font-size: 26rpx;
                margin: 35rpx 0 50rpx;
                border-radius: 10rpx;
            }
            .popbot{
                display: flex;
                flex-direction: row;
                align-items: center;
                justify-content: space-between;
                width: 100%;
                margin-top: auto;
                
                
            }
			.popbotitem{
                    width: 45%;
                    height: 65rpx;
                    border-radius: 50rpx;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                }
				.left{
                    border: 1rpx solid #5997FF;
                    color: #5997FF;

                }
                .quxiao{
                    background: #5997FF;
                    color: #fff;
                }
		.zhixiao{
			border-top: 1px solid #eee;
			
		}
		.zhibtn{
				width: 160px;
				height: 40px;
				background-color: #3B9BFF;
				border-radius: 20px;
				margin: 8px auto 14px;
				display: flex;
				align-items: center;
				justify-content: center;
				font-size: 15px;
				font-family: PingFang SC;
				font-weight: 400;
				color: #FFFFFF;
				
			} */
.daochu{
	display: inline-block;
	overflow:hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	-o-text-overflow:ellipsis;
	padding: 10px 6px;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 3px;
	cursor: pointer;
	width: 100px;
	color: #333;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-left: 20px;
}			
</style>

<style>
.rightview .el-input {
	max-width: 100px;
}
.rightview .xiadan .el-input {
    max-width: 200px;
}
.adpop .el-form-item {
    margin-bottom: 10px;
}
.el-step__title.is-success {
    color: #fb333e;
}
.el-step__description.is-success {
    color: #fb333e;
}
.el-step__head.is-success {
    color: #fb333e;
    border-color: #fb333e;
}
.el-checkbox__input.is-checked .el-checkbox__inner, .el-checkbox__input.is-indeterminate .el-checkbox__inner {
    background-color: #fb333e;
    border-color: #fb333e;
}
.el-checkbox__input.is-checked+.el-checkbox__label {
    color: #fb333e;
}
.el-checkbox {
	margin-bottom: 10px;
}
.el-radio__input.is-checked .el-radio__inner {
    border-color: #fb333e;
    background: #fb333e;
}
.el-radio__input.is-checked+.el-radio__label {
    color: #fb333e;
}
.rightview .el-checkbox__label {
    display: inline-block;
    padding-left: 10px;
    line-height: 19px;
    font-size: 13px;
}
.el-loading-spinner .el-loading-text{
	color: #fb333e;
}
.el-loading-spinner{
	color: #fb333e;
}
.el-loading-spinner i {
    color: #fb333e;
}
/* .el-loading-mask.is-fullscreen .el-loading-spinner {
    margin-top: -120px;
} */
.el-loading-mask.is-fullscreen .el-loading-spinner {
    margin-top: -25px !important;
    position: absolute;
    top: 90px;
    margin: 0;
	left: -130px;
}
</style>